<template>
	<view class="user-index">


		<view class="menu">
			<view class="uni-list">
				<view class="uni-list-cell" @tap="toTarget(item)" v-for="(item,index) in menuList" :key="index">
					<view class="uni-list-cell-navigate uni-navigate-right">
						<view :class="item.icon"></view>
						<view>{{item.name}}</view>
					</view>
				</view>
			</view>
		</view>
		
		
	</view>
</template>

<script>
	
	import Request from '../../common/request.js';
	
	
	export default {
		components: {
			
		},
		data() {
			return {
				token: '',
				menuList: [
					{
						icon: 'iconfont icon-shezhi text-success',
						name: '小店设置',
						url: '/pages/usershop/setting',
						type: ''
					},
					{
						icon: 'iconfont icon-fenlei1 text-primary',
						name: '我的商品',
						url: '/pages/usershop/select-goods',
						type: ''
					},
					{
						icon: 'iconfont icon-shangjia text-theme',
						name: '我的小店',
						url: '/pages/usershop/index',
						type: 'tab'
					}
				]
			};
		},
		onLoad() {
			
		},

		methods:{
			//获取用户信息
			getUserInfo(callback){
				var that = this;				
				var params = {
					url: 'user/index',
					sCallback: function(res) {
						that.userinfo = res.userInfo;
						callback && callback();
					}
				}
				
				Request.send(params);
			},
			toTarget(item) {
				if(item.type == 'tab') {
					uni.switchTab({
						url: item.url
					})
				} else {
					uni.navigateTo({
						url: item.url
					})
				}
			},
			back(){
				uni.navigateBack({
					
				})
			}
		}
	}
</script>

<style>
	
	
	.menu{
		margin-top: 10upx;
		font-size: 24upx;
	}
	
	.menu .uni-list-cell-navigate{
		justify-content: flex-start;
	}
	
	.menu .uni-list-cell-navigate .iconfont{
		font-size: 40upx;
		margin-right: 10px;
	}
	
</style>
